import json
from datetime import datetime
import time
from common.basic import send_message_to_kafka, generate_random_string


data = {
        "packetType": "http",
        "data": {
                "id": "4BBC3FE977D042B2970AD75D70E33E04",
                "httpType": 1,
                "host": "10.10.2.236:31269",
                "port": 31269,
                "httpDirection": 2,
                "uri": "/collect/upload",
                "fullUri": "http://10.10.2.236:31269/collect/upload",
                "requestIp": "192.168.37.1",
                "requestMethod": "POST",
                "requestTime": "2023-12-15 18:27:12",
                "requestTimestamp": 1702636032731,
                "requestTimestampStr": None,
                "requestContentLength": 9174,
                "requestContentType": "multipart/form-data; boundary=--------------------------338659086998196789205107",
                "requestHeader": "{\"Referer\":\"http://10.10.2.236:31269\",\"Authorization\":\"Para&158*abc34f\",\"Accept\":\"text/plain, application/json, application/*+json, */*\",\"Connection\":\"Keep-Alive\",\"User-Agent\":\"Apache-ParserClient/4.5.13 (Java/1.8.0_151)\",\"Host\":\"10.10.2.236:31269\",\"Accept-Encoding\":\"gzip,deflate\",\"Content-Length\":\"9174\",\"Content-Type\":\"multipart/form-data; boundary=--------------------------338659086998196789205107\"}",
                "requestBody": "2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d3333383635393038363939383139363738393230353130370d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2266696c6573223b2066696c656e616d653d227a6869667562616f2e6a7067220d0a436f6e74656e742d547970653a20696d6167652f6a7065670d0a0d0affd8ffe000104a46494600010100004800480000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc00011080096009603011100021101031101ffc4001c0001000202030100000000000000000000000607050801020403ffc4004010000103020204080d030402030000000001000203040506110712213116415155728193d113141722364261719192a1b1b23452c11523324353744562f0ffc4001b01010002030101000000000000000000000005060304070102ffc4003a1100010301020a0806020105000000000000010203040511061215162141515391a1223132345281b1d113236171e1f014c1332442627282ffda000c03010002110311003f00da940100401004010040100401004010040100401004010040100401004010040100401004010040100401004010040100401004040b16e91a8ed333e92db18adab6ec73b5b28d87933e33ee5354563493a23e45c54e656ed2c238a95cb1c298cee49ee402af48988ea1e4b6ad9037f6c51803eb99536cb1e9589a5b7fdd4ac4b8455cf5bd1d77d90f3f0ef11f39bfe46f72c992a93c062cbd5fbcf41c3bc47ce4ff0091bdc992a93c032f57ef3d070ef11f39bfe46f7264aa4f00cbd5fbcf41c3bc47ce4ff91bdc992a93c032f57ef3d070ef11f393fe46f7264aa4f00cbd5fbcf41c3bc47ce4ff0091bdc992a93c032f57ef3d070ef11f393fe46f7264aa4f00cbd5fbcf41c3bc47ce4ff91bdc992a93c032f57ef3d070ef12739bfe46f7264aa4f00cbd5fbcf43216dd25df695e3c65d0d5c7c6d919aa7e216096c4a67a746f6a9b506135646bd3b9c9f5fc168611c616fc491ea424c358d19be9de76fbc1e30abb5b674b48b7bb4b76970b36d882d04b9ba1db3db692451e4b0401004010102d2be2492d36d8e8289e5957560eb381dac8f8f2f69ddf1535635124f22c8fea6fa95ac23b49d4b12431af49dc93f2524ade73d08020080203296dc3f76b9d378c5be827a88758b75d833198e25af2d5c10bb16472229b9059f5350dc7898aa87ab81d8879a2abe558b28d2ef10cf91abb74a61278a4826921998592c6e2d734ef046f0b71ae472239bd4a473d8e6395ae4b950e8bd3e420080203ed45553d0d5c5534b23a29e270731edde0af89236c8d563d2f4532452be17a491adca86c6611bd32ff0061a6ae680d91c356568f55e378ff00ee5544ada65a59963d5abec754b36b52b69db3275ebfb9985a86f84010040507a55a9754634ab6b8f9b0b591b7dd967f7255d6c7623295abb6f539a61148afae722eab9088a9420c2008020080bc3435e883bfecbfecd54fb77bcf927f6744c17ee5ff00a5fe89d2862c66b3e26f48ee9ff664fc8ae8349fe067d93d0e476877a93fecbea6356c1a810040100405b3a0fa97182e94c4f98d732403da4107ec15670819d263fee85db04a5556c91ead0a5a2ab85c4200802035ef495e9adcfa4dfc42bcd95dd1872fb7bbfc9fba88ca90220ed1375e56333cb59c067ef2bc55b92f3e9a98ce442db1a25a4201feab51d937bd563381fe04e25db34a2de2f01e496939d6a3b26f7a6703fc09c4f734a2de2f01e496939d6a3b26f7a6703fc09c466945bc5e04cf08d823c376a34314ef9da64749aee68076e5b3e8a26b6ad6ae4f88a9768b89eb3681b410fc16bafd3799a5a84815d5c745f4b5b70a9aa75ce763a791d21688c6ccce796f53b15baf8d88c462684bbacab4f82f1cd23a459174aaaf51e7f24b49ceb3f64def5933824f02713166945bd5e03c92d273acfd937bd3381fe04e2334a2deaf03078cb0053e1fb14b5f157cb3398f6b751cc001cce4b7286d77554c912b6e23ad4c1f8e869d676bd56ebb56d2be53855c202d1d077ea2edd18fee5573083b2cf32e3825da97cbfb2d95592ec10040101af7a4af4d6e7d26fe215e6caee8c397dbddfe4fdd44654811072d25ae0e69c8839829d67a8b72de867385f8879deafe75a793a9776848e58aedea9c70b71073bd67ce993e9b7687995eb77abc4ea715df8ffe5eb3b42bdfe0536ed381e656addeaf12dfd14d7555c30bba6aea892797c61edd790e672c86c556b622645518ac4b92e42f383b3c93d263caebd6f5ebf2262a289e284bfe2ebfd3df2e10c374a86451d43dad68cb20038e4372bad359f4ce858e7312f54439ad6daf5b1d448c6c8a888abea63f86588b9dea7e23b967c9b4bbb43572d576f54e38638879deabe61dc99369776832cd76f54f35c3115dee34cea7aeb8544f0388258f766091b9648a8e089d8d1b1114c33da35550cf872bd550c52d9348202d1d077ea2ebd18fee5573083b2cf32e3825da97c8b65564bb040100406bde92bd35b9f49bf88579b2bba30e5f6f77f93f751195204404048b02b2ccfbcbc622318a3f04ecbc21206b6632ddd6b46d15a848bfd376af256c76d2acebfccecddaf6f913ff0017d1c7fc949da48a0f1ed6faf22cdf0ec2da9c5478be8e3fe4a4ed244c7b5bebc87c3b0b6a71533567c41842cf4869add70a58602e2fd50e71da77eff72d49e92ba7763c8c5552429ad0b32959f0e17a22799eee1ae1de76a6faf72c3932af76a6c65aa1dea11da83a3ca99e49a77d0be591c5ee7173f693b495bcd4b518d46b516e4fb118f5b0e472bdcadbd7ee65e8f07614ada58ea296dd0c904a3598f6bdf911cbbd6b3ed2ad8dcac73d5153ec6ec763d9b3311ec8d1517eabee769b03e198a27c8fb6c61ac69713aeedc3ad78db52b1cb723fd0f5f61d9ed4572c7a13eabee5075058ea895d1375632e25a0710cf62bb36f46a5fd673491515caadea3e6bd3e0202d1d077ea2ebd18fee5573083b2cf32e3825da97c8b65564bb040100406bde92bd35b9f49bf88579b2bba30e5f6f77f93f7511952044040101ceabbf69f825e7b72ec3aa1e1ca0080fa5340fa9a98a0886724af0c681ca4e4be5ee46355cbd487dc71ac8f4637ad741b3b6ba46d05ba9a91996ac31b63197b064b9e4d22caf73d75a9d7a9e248626c69a9110c0692ae7fd33095639aeca59c78066de376ff00a66b76ca83e354b517a934f0236ddaafe3d13d53ad74279fe0d7d57839804010168e83bf5175e8c7f72ab9841d9679971c12ed4be45b2ab25d8200802035ef495e9adcfa4dfc42bcd95dd1872fb7bbfc9fba88e411493ccc8a163a495e435ad68cc927882df7391a8ae72dc845318e7b91ad4bd54b4f0c68c231136a310caed6233f168dd906f49ddcab7576eadf8b4e9e6bfd2173b3f05db723ead7c93fb5f62551f03ec8046d36a81c394b5cef8ed2a357f9d51a571978932dc9747a1311385e7b29eff876a0f8386bedeecfd5d668fbac4ea4aa6e956a99d96850bfa2d7b791f7a8b1592e51eb4b4145334facd6376f585f0daaa8856e472a191f43495097b98d5f24fe88edcb46563aa04d3787a479dde0dfacdf815bd15b952ced5ce22e7c19a3934b2f6afd3f2442eda2dba53eb3add51055b06e6bbfb6efaecfaa9586de85fa24454e64154e0b54334c2e4727053e9a37c275d0e2af0d75a3960651b7c20d71b1cf3b064771e32be6d5b42375362c4ebf1bd0fbb0ac9999598f50c54c4d3a76ea2e45542f852ba62bc8adbdc56e85d9c5463cfcb8e43bfe032faab6d874df0e25957adde873fc27adf8d3a40d5d0cebfbafb15fa9c2b0100405a3a0efd45d7a31fdcaae6107659e65c704bb52f916caac97608020080d7bd257a6b73e937f10af36577461cbedeeff0027eea251a22b5d3c34f5d7fad00329f3646e77ab90cdcef7e5b3e2a3adb9dce736999aff005098c19a5631afad97fdbd5f4daa46317632b85feaa46b657c1400e51c0c3966395dca5485159b152b51552f76df6222d2b667ad7aa22dccd49efb48c29121c203d96eba57db640fa0ac9e9dc3f63c81f0dcb14b047325d23514d882aa6a75be27aa13ab0e94aba9cb63bc40daa8f71923f35e3ab71fa286a9b0a37e9856e5e458e8f0a668fa350dc64da9a17d8b36c188ed97d8b5adf52d7bc0cdd13bcd7b7de157aa68e6a65ba46f9ea2dd4768d3d6b6f85d7aecd7c0cbad5378e1e09690d3aa48d872dc8878a97a6829dc43a33bb09e6a9a2ab8eb8bdc5ee0ff0031e49dbee2ad54d6dc17231edc5bbcd0a256e0cd4e32c913b1efdba17d882dcad35f6b90b2e1473d39ff00dda403ee3b8a998aa22992f8dc8a5727a49e996e998a87896635c202d1d077ea2ebd18fee5573083b2cf32e3825da97c8b65564bb040100406bde92bd35b9f49bf88579b2bba30e5f6f77f93f75131c3ed2ed0ddc043fe7ab2eb65d2dbf451353a2d46e37d09ea2455b0de8dff0097ef02a856629410040101cb1ae7bdad634b9ce390006649455444bd4f511556e42e4d1ae0975acb2e9756655a47f6a23fea078cfb7ecaa76ada6937c98bb3ad76fe0be583622d35d513f6b526cfc961c8f6c6c73e4706b1a332e2720072a8344555b90b4b9c8d4bd7a8c7d9efb6cbc35c6dd5914e5a722d07270ea3b5679e966a7ff236e3569aba9ea93e4bd14c92d736ce93451cf198e68d9230ef6b8020f52f5ae56aded5b8f9731af4b9c97a113bce8f6c3710e7474eea398faf01c87cbb949c16c54c5a157193ea42d560f51d46946e2afd3dba8835e345d74a6d67db678ab183734f98ff00aec3f153305bb0bf44a98bcd0ae5560b5447a61723938299ad105b2b6d95d758ae14b353bf5599091b967b4ee3c6b52db9e3998c58dc8bd64860cd34d4f24ad99aa8ba3acb39574b7840100406bde92bd35b9f49bf88579b2bba30e5f6f77f93f7512bd0e5d61920adb1d59044b9c91b5deb0232737ec7e2a32dca7722b6a59ab47b13582f54c735f4726bd29f5da847319e09aeb155492d3452545b9c73648c19960e470e2f7adfa0b4e3a96a2396e76cf622ad4b126a37ab9897b36ecfb911528419c2033562c3375be48050523cc677ccf1aac1d67f85a9515b0d327cc769d9acdfa3b32a6b17e53746dd45c18370251580b6a6a08aab80ff00611e6c7d11fcef556aeb564aae837437d7ee5eacbb0a1a1ba47f49fb767dbdc95d5d4c1474d24f552b2286319b9ef3900146318e91c8d625eaa4d4b2b226abdeb72214ae9031cc97b2ea1b697456d07ce76e74defe46fb15bacdb2d29be64ba5de8502dab75d597c306867afe084d3cf2d34cd969e47c52b4e6d7b1d911d6a5dcd47a62b92f42bac7ba3763316e527d87349d5f45ab0dde3f1d846cf083cd907f0542d5587149d28571579166a1c279a2b9b5098c9b75fe4b42c3892d77d8c3adf54d73f2ccc4ef35edf7855ca9a29a996e91be7a8b8d1da54f5897c2ebd766be06616a9bc1004010040100406bde92bd35b9f49bf88579b2bba30e5f6f77f93f7511ea5a89696a239e9a4745346e0e63da7220ade7b1af6ab5c97a29171c8e89c8f62dca85bb85b49949531329efc3c5e7cb23334671bfda4717d955eb2c47b171a9f4a6cd65e2cfc268a44465574576ea5f62582830ede409594f6dabd6f5dad6b89eb0a33e2d553f4555c9c49b48286afa48d6bb81f5a6c3765a6787c36ba36b86e3e081fbaf9756d43d2e57af13ed966d246b7b634e07b2aabe86df16753534f4f1b7f7bc34058991492af451554cf24f0c097bdc8d4fb90dbee936d3441ccb735f5d37116f9ac1d67f80a569ec49e4d32745399035984d4d0e887a6bc10ab712e27b9e219b5aba6ca169cd9047b18deae33ed2ac74b430d2a7cb4d3b7594eafb52a2b9d7caba362751845b847040101da291f0c8d9227b99234e61cd3911d6bc7351c972f51f4d72b1719ab7293bc39a4bb95bf562ba37c7e9c6cd6272900f7f1f5a86aab12197a5174579163a1c26a883a33a63a732d1c3f8a6d37e60f11a96f86cb6c3279af1d5c7d4ab953413d32fcc6e8dba8b8d15ab4d5a9f29da762f599c5a6488401004010146697a81d4b8b1d5197f6eaa36bc1f68d87ec3e2ae3624a8fa6c5d6d539ce1340b1d663ea725ffd108530578203b46f7c6ed68dce63b95a722bc5445d0a7d35cad5bdab71e8fea35d965e3b53972785777af8f831f8538197f93378d78a9e67bdd23b5a4739eee571cd7da222751855caed2aa70bd3c0802008020080203963dd1bc3d8e2d7b4e61cd3910bc54454b94f5155ab7a75979689eb6e770b04b3dcea1f3c625d485cff00f2c80dbb78f6fd953ad98a18a646c49768d2745c1c9ea27a657ceebd2fb909ba882c2100401011bc7986db892ce62616b6b213af03cf2f1b4fb0a90b3ab56925c65ecaf59136c59a968418a9da4d29ede66bfd6d24f435525355c4f8678ce4e6386442bb4723646a3d8b7a29cca585f0bd63912e543e2becc610040100401004010040100406630be1facc4371653523086020cb291e6c6de53edf62d5abab652478eff24da6fd9f67cb5f2a471a68d6bb0d87b4d0416bb753d152b75618581adf6fb4fb4aa2cd2ba67ac8feb53a8d353b29a26c51f521eb588ce100401004061b1061ab5dfe30db8d38748d193656f9af6f5ff0b6e9ab66a55be35d1b351a15b66d3d6a5d3374edd641eaf44b1179349747b59fb658c13f10429866103aee9b38295d93049b7fcb938a1e7f24b373ab3b23debef381be0e662cd276f790f24b373ab3b23de99c0df07319a4edef21e4966e7567647bd3381be0e63349dbde43c92cdceacec8f7a67037c1cc6693b7bc879259b9d59d91ef4ce06f8398cd276f790f24b373ab3b23de99c0df07319a4edef21e4966e7567647bd3381be0e63349dbde43c92cdceacec8f7a67037c1cc6693b7bc87925979d59d91ef4ce06f8398cd276f79190b6e8a68627875c2ba6a803d4634301ebda56096df91c9746d44e66d418290b56f99eaefb6827d6cb7525ae95b4f414f1c10b7d560dfed3ca542cb33e6763c8b7a965a7a68a999f0e26dc87ad623384010040100401004010040100401004010040100401004010040100401004010040100401004010040100401004010040101fffd90d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d3333383635393038363939383139363738393230353130370d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2266696c6573223b2066696c656e616d653d2269666e313130342e706e67220d0a436f6e74656e742d547970653a20696d6167652f706e670d0a0d0a89504e470d0a1a0a0000000d49484452000000c8000000a0080600000049ff23a9000000097048597300000ec300000ec301c76fa8640000001974455874536f667477617265007777772e696e6b73636170652e6f72679bee3c1a00000d1149444154789ceddd79d01c4519c7f1ef9be44d2221c8cb11088110402211133014020241205c45b8a4e412500e2911c550207804887f508522a5786015720504044b44e4b020978a0129af40b884e40d504042424842f2e678e17dfde3d9aded99dd9d7776b77b678fdfa76aaa66dfcc74f76ea667a667ba9f06111111111111111111111111111111111111111111111111111111111111111111111111111169681d5917a08d0d078e070e050e04c600db024380f7816ee0dfc05ce051604336c514a9af1d819b8055407fca650df043a02b83f28ad4c560e04a602de92b467c790fb80c1854e7b2b72ddd62d5c776c0bdc05125fe6d15301b58022c033ec26eb526020763579cb88780738075210a2b524f3b002f537c35980d1c81b539ca19041c0d3c5662ff8594ae3c224de3e3c073440fecb7287d2519c831b97dddb41600c3bc94542403f7103da09f0576aa21bd1d817fc4d29c5563194532711ad103f905602b0fe97601ff8da57d9c877445ea6608f02ad1a74f7b784c7f0fa24fc316a2275bd244ce217a86ff56803cbe19cbe34b01f21009e2490a076e37611ad2c380d79d7ce605c843c4bbed805e0a07eeb501f39ae9e4f3117ad32e4d601ad15b9fc901f39a14cbeb848079b52535ecfcdbdb59ff00f84fc0bc16013dcee74f05ccab2da982f837d6597f073bb387d2072c763eef1c30afb6a40ae2df50677d451df273af205bd621bfb6a20a12d6c7ea9047a7b3aece8b9ea982f8f7a6b35e8fce84ee2dddca3ae4d7565441fceb76d677226cbb602cf65839ef958079b5255510fffe16fb7c74c0bc8e8d7d5e1030afb6d4ee03a63a8003801381bdb0b3fd48acef543776b03f8a7533afc42bc0f8dcfadf81437c14b6846781fd73eb2f03132adc7f676c5cfc21c06ed840adcdd8c3856ee009ac57c06a1f8595e63118b88868578d724b2ff02036c22fadefc4d298eaabe08ea9b13caea860df7db051891f32f0f7df04fc0a3d426e1b13b1176c958e07ef056e20790460de36c07a67df45f87da2351cbb4ae5d35f0b6c9f62bf4ee046d2558cf8b201eb20292dec784a074d58013c829d296f00eec4c66ff495d8760e3652702057c7f6bbc3d377e8007e134bfbbb29f6eb02e653fc7dfab00a3c0bf831f033e00fc0bb25b6cd7f8fa148cbf93c767fedfe673f83b53f3acbec331ef825d1ce87f99eb303f5d01d8a553277bf9ba8addd3708f8692ccd45d81525c970e0afb1fd7a819b29b4954ae5751cd6868a5792db6af80ed280c6615709f7e0b81c6b8ba4b11fb094e84172738afd266041e0dcfd1e22fa6836ad51c01f6369ada1fc01eeba25b6df52ec3ba5d1015c4af149627afaa24ba37b9068b7f0b3ab486334169ac7bd35392cc57e4760dd41dc836b397680a569978cc4065cbd174b631d7078cafcdd5bc5d7a8ee05e62944db2e3da8e1de120e207a805c53435a9f06363a69fd25e57e076295227eabb21ab81bb800f82cb03b369cf660e07c2c96d6ea12fbad043e9732efa79cfd36505b8fdfefc5ca716b0d694983701bb48b19f87e7d20d7113d48f64db9dfaec09f293ed82b5d9e207d6494c9b17d7f9072bf723a81179df436035bd798a6646808d118b85ff590e6f6441fe14eab70ff33288e959566791e3895ca1af92739fbafa7bab64fdc85b1729de9214dc9c84144db1ebe3a0f9e83bd87b89374ef454a39027b42f61aa52b445feedf7e81b535aae916d4893dbe7d0938abca72c67561bf65be9c777a4a5732703a85ffc817332e4b929158fb662ad6b6d8071891698992b9b759f3322e4b50d59efd9ac56867fdbdc0790dc6ae0ad3b086f628ead719b40f7b08b0187be13937f7b750dea6d0ef6b74d286d2d8a6136ddc867238d646a8b501ee6b5948ba47d0d59ae3e4f572c07c243037fce7d240797c83eafa36855e7a81af07faceee2dd6dc4079348456bfc57ac3591f8b75225ce531fd2f627d97dc274b2bb06ef2f51eddb73d369d5bfe49d510ac81bf1cf8bdc77cb6063ee97c7edd63da52674388be81bed463da5d441f21f7625dceb3ecc83714b88a68b79095f87d577111d12bd5191ed3960cdc4de13ff37ff8bb6ace247aa034526cdc738996ed6a4fe976628f8cf3e96e225dcf666960fb13ed6a72bda774dd3125b33da5e9d35ca28d761fe25df86ff194ae64ec77445f189e5e637ac38956ba0b6a4c2f04f756a88fda6ffd4e25fa82703db54d06240d6417a29d05fbb08e7769bb6dec099c4ce1e5dd38a267d2233d96d597f890dc5d737f1f817541493b5fc920ec7179fc499dcff69c348043291e30b510ebc65dae5d3211b88fc299337f2b353e96ce9460a5aede14a265dc33f7f7d9141e2adc42f9400f83b160d84fc7d2e9077e1dacd40da6dda29a1c0bdc4ff15468ebb0d1854b729fb7c6ba9c8f896db71e0bef399e680caac3b0117b8d640ad1eef8e3b159af7a281e87f22236addb32ec64b13bd6e5659b12e9de0e5c8c9d6ca405ed8d5d39aa79f176792e8d66be827c9bea5e6cf60097d4aff892a541d88024778460b96533f6a2cd1d68d4cc1504ac63e483140fa32db56cc45e38b66583bcd5dfa497d387dd2adc8e8dcd3e097b3b3c167baebf12eb6afe34f030d6c06f258b802f60ddff4fc486057c020b1cb711bbd57a8342e0b80fb229a634ab66bf82484aad1a9b7738d689703ea5c78257b3aca1351e6d4ea7746cb06a9665d86f7c09b50f65963a998cc595f57100c49775d893bf66bd8274501c61c5d7b204f84c5dbe591db5da15641fecd1e6b840e9ff0b3b189a553ff61d42d80d7bd43d2950fa9968a5467a27f000d169c85e007e8b85d1acd53aacc1deec8ec31ae63ea66b1b858d75cfbf6cdc12fbbd27618f92a581c47bb0de46b8aee7cd7a8b15c2302c5eaf9b5723f56cae492bdd629de2ac2fc61a8e7adb1bde26ecb7ee76fe764a996d9b4e2b55103746edc3d8f37ca98f1ee04fcee7bdb22a886fad5441dc5173ef67568af6e5468de9caac149eb5520511f14e154424812a88480255109104aa20220954414412a882882450051149a00a229240154424812a88480255109104aa20220954414412a88288245005a94e3c704323c6388e97a999834d644615a43af1790e4b0579ceda76b1cfa1a7c16e49aa20d5594574d4e2e1591524815ba695689465555441aad30f3cee7c3e9fc204358d6037e03ce7f3e3e5369464aa20d5fbb9b33e0278040b7e9db55db1000a5be43ef76353554b155a29705cbd3d03dc85c5e3029b526011366bd31c2c58dd666c56d85041d4866041db866241dca6627313ba41e16e03fe19287f69226f51085ce66bdae3816c012c203966ed02c29c883ab14a9a94f75314cf2615ca354ebe6fd529cfe0748b559b1eecac7d77c2360761738ff8b6177040997feb07660147011b02e4dd365aa982b881e242851c2da507bbcd9a82c5a52d35d9ccb000f996fa8e1f60938e4e01be427d2b873bfd8182f635a0f9142ef1b393370dee18a2b73a9303e4b15f2c8fa303e45189f914ca3227dba2f8d34a5790279df52381d3ea9cbf7b065d51e7bce3798ea0be6ff7cfc266facd7bb2dc86929d51d81405f9b3582f703df694a70bffb75d5dd83c245fc6a651de0c5c91fbb7c9d4ff0a929fbc663af6dd5fc06efdc6e13f14e8d05c9a13801f119d35772dc56ff1a5415c48f9273a1b80b33de431169be0b3541ef97948b2ac202bca94ed5560170ff99e8bfd96e57ee7f3caef2a8de072cacf03bed043fa579549bb1f6b2043b615e4fe84f25de921dfe7caa4fd21709987f41b4a2bb541f26ec41ead3e864df7ecdaa278f38a957aafb004f81a859786593a1bb8182b539c8fef1f4fa30f78143810f88987f4a58eb6c2e642776f336a35d3496f19a56f5bb2bc82b876c99531bfcd4c0ff9bab797b703233da4d9b05af10ae25a8b1d20a16c04de0c987eadde24ec3b8965947eefd3325abd8288d444154424812a88480255109104aa20220954414412a882882450051149a00a229240154424812a88480255109104aa20220954414412a88284f151ec7388df79f000798a07aa20954b132de4ddd8e7d101ca3126f679798a7d1a711e9386d60e15648db3ee23bac7b6ce7ab9290596139d8fe3040ff9c64d73d657503ed490cfefdf41f4fbafae313d690027131d9a3ab586b446004b9db4ee4bd8f60e67bb4dc0be35e41bb71f1666289ffead09db3ee06cd74d6de3d28f25fa5b9e58435ad220b6c48685e6ff5397007b5491ce702c9abb7b802405a7db9b687495b78143aac8376e0af08e936e2f16a7b79c3389967916d58542dd93e8c9610d7e824034b476b927bd9668c082f558c0819748d7b8dd018b1ee81e88cf63811292f6bf1e0b1394d78f451d9c47f1346e03d9068b187924d1ffb7eb801909fb0dc142f54c70fef612702fc56da55206e7f6bd8068859891cb5b5a40277650968b1755e9b206bb420c6430c971aa6a5dee255d3b722216c0c257be73b0df545ac808ec80aaf5e07815985441be1dc0f7b1ab96af03741d7665aae40e605fca4784ac64b98736b8b56a678761f3792c25dad04d5a960373b1e070d5c6f81d834decf3742ebd4a0fcce5b97d67003b555986615850b97915946133f65bdd85b57f4444444444444444444444444444444444444444444444444444444444444444444444444444441ac7ff0190414e60a0c40dae0000000049454e44ae4260820d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d3333383635393038363939383139363738393230353130370d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2266696c6573223b2066696c656e616d653d227878652e786d6c220d0a436f6e74656e742d547970653a206170706c69636174696f6e2f786d6c0d0a0d0a3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e0d0a3c21444f435459504520414e59205b0d0a3c21454e54495459206578742053595354454d2022687474703a2f2f777777772e62616964752e636f6d223e0d0a5d3e0d0a3c6e616d653e256578743b3c2f6e616d653e0d0a0d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d3333383635393038363939383139363738393230353130372d2d0d0a",
                "sensitiveChars": None,
                "statusCode": 200,
                "costTime": 18,
                "responseIp": "10.10.2.220",
                "responseTime": "2023-12-15 18:27:12",
                "responseTimestamp": 1702636032731,
                "responseTimestampStr": None,
                "responseContentLength": 0,
                "responseContentType": "application/json",
                "responseHeader": "{\"Transfer-Encoding\":\"chunked\",\"Keep-Alive\":\"timeout=60\",\"Connection\":\"keep-alive\",\"Vary\":\"Access-Control-Request-Headers\",\"Date\":\"Mon, 10 Oct 2022 13:54:38 GMT\",\"Content-Type\":\"application/json\"}",
                "responseBody": "{\"code\":\"200\",\"msg\":\"响应成功\",\"data\":{\"nodeResult\":{\"cycleType\":\"0\",\"cmd\":\"tcpdump -i ens192 tcp  -C 5\",\"collectStartTime\":null,\"collectEndTime\":null,\"enableCollect\":true,\"updateTime\":\"2022-10-10 21:52:40\"},\"uploadResult\":{\"ip\":\"192.168.2.113\",\"port\":80,\"username\":\"api_scp\",\"password\":\"apiscp\",\"path\":\"file:/opt/api/data/agent/upload\",\"cycleType\":0,\"enableUpload\":true,\"startTime\":\"17:10:00\",\"endTime\":\"17:15:00\",\"updateTime\":\"2022-09-28 09:52:52\"}}}",
                "complete": True,
                "project": "scan_api"
        }
}

current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
current_timestamp = int(time.time() * 1000)

# 替换时间与时间戳
data["data"]["requestTime"] = current_time
data["data"]["requestTimestamp"] = current_timestamp
data["data"]["responseTime"] = current_time
data["data"]["responseTimestamp"] = current_timestamp

# 替换ID
data["data"]["id"] = generate_random_string(32)

# 写入报文txt，读取报文内容

pwd = '../filesOutput/文件上传漏洞.txt'

with open(pwd, 'w') as file:
    json.dump(data, file, indent=4)
print("已更新报文")

file = open(pwd, 'r')
file_content = file.read()
file.close()

# 发送消息到Kafka队列
send_message_to_kafka('10.10.2.233:30766', 'api-neta-parser', pwd, data)